{include file='admin/header.html'}

<!-- 搜索框 -->
<div class="layui-form">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">网站名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" value="" placeholder="请输入" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">网站地址</label>
            <div class="layui-input-block">
                <input type="text" name="url" value="" placeholder="请输入" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <select name="status">
                    <option value=""></option>
                    <option value="0">正常</option>
                    <option value="1">禁用</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">日期</label>
            <div class="layui-input-inline" style="width: 100px;">
                <input type="text" name="start" placeholder="yyyy-MM-dd" class="layui-input date">
            </div>
            <div class="layui-form-mid">-</div>
            <div class="layui-input-inline" style="width: 100px;">
                <input type="text" name="end" placeholder="yyyy-MM-dd" class="layui-input date">
            </div>
        </div>
        <div class="layui-inline">
            <button type="submit" lay-submit lay-filter="search"
                class="layui-btn layui-icon layui-icon-search"></button>
        </div>
    </div>
</div>

<!-- 数据表格 -->
<table id="dataTable" lay-filter="dataTable"></table>

<!-- 头工具栏 -->
<script type="text/html" id="toolbar">
    <div class="layui-btn-group">
        <button class="layui-btn layui-btn-sm layui-icon layui-icon-delete" title="批量删除" lay-event="delAll"></button>
        <button class="layui-btn layui-btn-sm layui-icon layui-icon-addition" title="添加" lay-event="add"></button>
        <button class="layui-btn layui-btn-sm layui-icon layui-icon-refresh" title="刷新" lay-event="refresh"></button>
    </div>
</script>

<!-- dataTable render -->
<script>
    var render = {
        elem: '#dataTable',
        toolbar: '#toolbar',
        defaultToolbar: ['filter', 'exports', 'print'],
        cellMinWidth: 80,
        height: 'full',
        where: { search: '' }, //搜索
        title: '链接列表', //数据表格标题
        page: true, //开启分页
        cols: [[
            { type: 'checkbox', fixed: 'left' },
            { field: 'id', title: 'ID', sort: true, width: 80 },
            { field: 'name', title: '网站名称', sort: true, edit: 'text' },
            { field: 'url', title: '网站地址', sort: true, edit: 'text' },
            { field: 'logo', title: 'Logo', sort: true },
            { field: 'sort', title: '排序', sort: true },
            {
                field: 'status', title: '状态', sort: true, width: 90, templet: function (d) {
                    return '<input type="checkbox" name="status" lay-filter="status" value="' + d.id + '" lay-skin="switch" lay-text="ON|OFF"' + (d.status == 0 ? ' checked' : '') + '>';
                }
            },
            { field: 'time', title: '时间', sort: true },
            {
                title: '操作', align: 'center', width: 125, templet: function (d) {
                    return '<button class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" title="编辑" lay-event="edit"></button>' +
                        '<button class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" title="删除" lay-event="del"></button>';
                }
            }
        ]]
    }
</script>

{include file='admin/inc/dataTable.html'}

{include file='admin/footer.html'}